﻿#include "MainWindowEventFilter.h"
#include "PostProcessing/MainWindow.h"
#include "BaseWidget/SAFramelessHelper.h"

namespace pst
{
    MainWindowEventFilter::MainWindowEventFilter(MainWindow* mainwindow)
    {
        m_mainWindow = mainwindow;
    }

    bool MainWindowEventFilter::eventFilter(QObject* obj, QEvent* evt)
    {
        if (m_mainWindow)
        {
            QObject::eventFilter(obj, evt);
            //printf("通过事件过滤器调用 主窗口的无边界事件\n");
            return m_mainWindow->framelessHelper()->eventFilter(m_mainWindow, evt);
        }
        else
        {
            return QObject::eventFilter(obj, evt);
        }

    }
}

